// com.iot.gateway.tsl.model.TslEventEntity.java
package com.iot.gateway.tsl.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 设备事件固定字段实体
 * 对应表 tsl_event，含 type、required、output_data
 *
 * @author guoxinyu
 * @create 2025/5/27 18:20
 */
@Data
@TableName(value = "tsl_event", autoResultMap = true)
public class TslEventEntity {

    @TableId(type = IdType.ASSIGN_UUID)
    private String eventId;

    private String deviceId;

    private String name;

    private String description;

    private String type;

    private Boolean required;

    /**
     * JSON 列，将 output_data 存为 JSON 数组
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<Map<String, Object>> outputData;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;
}
